#include <iostream>
#include "Server.hpp"
#include "Dict.hpp"

int main(int argc,char* argv[])
{
    if(argc != 2)
    {
        LOG(INFO,"./udpserver port\n");
        exit(1);
    }

    uint16_t port = std::stoi(argv[1]);

    Dict dict("./Dict.txt");
    func_t translate = std::bind(&Dict::Translate,&dict,std::placeholders::_1);

    std::unique_ptr<Server> usvr = std::make_unique<Server>(translate, port);
    usvr->Init();
    usvr->Start();

    return 0;
}